package nautilus.moneykeeper.system;

import java.util.Locale;
import java.util.Properties;

import android.app.Activity;

public class SystemConfig {
	public static int LANGUAGE = Constant.LANG_VI;
	public static Locale LOCALE;
	
	private static Properties PROPERTIES;
	private static Device DEVICE = null;
	
	public static Device getDevice(Activity act){
		if(DEVICE == null)
			DEVICE = new Device(act);
		return DEVICE;
	}
	
	public static void loadProperties(Properties props){
		PROPERTIES = props;
		
		String temp = get("language");
		if(!temp.equals("null"))
			LANGUAGE = Integer.parseInt(temp);
	}
	
	final static String get(String property) {
		try {
			return PROPERTIES.getProperty(property);
		} catch (Exception e) {
			//Log.d(TAG, "Property " + property + " is null!");
			return "null";
		}
	}
	
}
